package org.advanced.publish;

import redis.clients.jedis.Jedis;

/**
 * @author John.zhang
 * @version Id: ListenTest, v 1.0 2020/12/22 17:53 ZhiYong Exp $
 * 连接redis并订阅2个通道
 */
public class ListenTest {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("10.181.144.255", 6379);
        final Listener listener = new Listener();
        // 使用模式匹配的方式设置频道
        // 会阻塞
        jedis.psubscribe(listener, "channel-*", "channel-*");
    }
}
